package com.fbs.wowo.correctRight.web;


import com.fbs.wowo.base.BaseController;
import com.fbs.wowo.base.Response;
import com.fbs.wowo.correctRight.entity.CertificateType;
import com.fbs.wowo.correctRight.service.CertificateTypeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("corr")
public class CertificateTypeController extends BaseController {

    @Resource
    private CertificateTypeService certificateTypeService;

    /**
     * 插入
     * @param certificateType
     * @return
     */
    @PostMapping("insert")
    public Response insert(CertificateType certificateType){
        certificateTypeService.insertSelective(certificateType);
        return success();
    }

    /**
     * 列表
     * @return
     */
    @GetMapping("findAll")
    public Response findAll(){
        return success(certificateTypeService.findAll());
    }


    /**
     * 根据ID查询
     * @return
     */
    @GetMapping("select")
    public Response select(String ctId){
        return success(certificateTypeService.selectByPrimaryKey(ctId));
    }
}
